<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string("phone", 15)->default(null)->nullable();
            $table->string("name", 15)->default(null)->nullable();

            $table->integer("status")->default(0);
            $table->timestamp("called_at")->default(null)->nullable();
            $table->timestamps();
        });

        \App\Models\User::create([
            "name"      => "au",
            "phone"     => "13800138000",
            "status"    => 0,
            "called_at" => null
        ]);

        \App\Models\User::create([
            "name"      => "au_tt",
            "phone"     => "13800138001",
            "status"    => 0,
            "called_at" => null
        ]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
